#include<stdio.h>
int main()
{
	int n;
	scanf("%d",&n);
	int sum=n;
	int empty=n;
	while(empty>=2)
	{
		sum+=empty/2;
		empty=empty/2+empty%2;
	}
	printf("%d",sum);
	return 0;
}
